import request from "@/util/api.js"


/**
 * 产品搜索
 * @param {Object} data
 */
export function getProductSpuListApi(data) {
	return request.get('product/spu/lst', data)
}

/**
 * 获取搭配商品
 * @param {Object} data
 */
export function getProductCollocationApi(data) {

}

/**
 * 获取店铺商品列表
 * @param {Object} mer_id
 * @param {Object} data
 */
export function getMerchantProductSpuListApi(mer_id, data) {
	return request.get(`product/spu/merchant/${mer_id}`, data)
}

/**
 * 获取秒杀时间段
 */
export function getSecKillTimeApi() {
	return request.get('store/product/seckill/select')
}


/**
 * 获取秒杀时间段商品
 * @param {*} data 
 */
export function getSecKillProductListApi(data) {
	return request.get('store/product/seckill/lst', data)
}

/**
 * 推荐 用户经常购买或浏览商品
 * @param {*} data 
 */
export function getUserProductVisitApi(data) {
	return request.get('store/product/visit', data)
}

/**
 * 获取商品分销二维码
 * @param {Object} proudctId
 * @param {Object} data
 */
export function getProudctQrCodeApi(proudctId, data) {
	return request.get(`store/product/qrcode/${proudctId}`, data)
}

/**
 * 获取产品的搭配商品
 * @param {*} productID   主商品id
 * @param {*} data 		  search
 */
export function getProudctCollocationApi(productID, data) {
	return request.get(`store/product/collocation/lst/${productID}`, data)
}

/**
 * 用户对购买商品评价
 * @param {*} order_proudct_id 
 * @param {*} data 
 */
export function userProductCommentApi(order_proudct_id, data) {
	return request.post(`reply/${order_proudct_id}`, data)
}


/**
 * 获取用户推荐商品 最近常买
 * @param {*} data 
 */
export function getUserProudctRecommendApi(data) {
	return request.get('store/product/visit', data)
}

/**
 * 商品详情
 * @param {*} productId 
 */
export function getProductDetaiApi(productId) {
	return request.get(`store/product/detail/${productId}`)
}
